Skip to content

fix: resolve cross-package test failures and type errors - #276

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-1025-1794102477
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-1025-1794102477

Conversation

@stooit

@stooit stooit commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes bun test (13/13) and tsc --noEmit pass from the repo root. No test files were changed and no dependencies were added.

  • bunfig.toml: environment = "happy-dom" is not a Bun option, so it was ignored. Replaced it with a preload of the existing packages/ui/test/setup.ts, which uses the already-installed @happy-dom/global-registrator. This fixes the document is not defined errors.
  • apps/web/src/lib/api.ts: now imports the renamed useDebounce instead of the old name useThrottle.
  • Button.tsx: the aria-label prop is now applied to the <button>. Icon-only buttons with no label fall back to "Button".
  • DataTable.tsx: the sort toggle now uses a functional state update (setSortDir(prev => …)), which fixes the stale closure.
  • date.ts: formatDate now outputs D/MM/YYYY, e.g. 1/03/2024. It builds the string from formatToParts, because en-AU zero-pads the day in this environment.
  • tsconfig.json: added "types": ["bun-types"] so bun:test resolves during type-checking.

Assumptions / follow-ups

  • The test requires icon-only buttons to have a non-null aria-label, so a fallback is needed. "Button" is not a descriptive name for screen readers, though. Callers should always pass a real label, and a dev-mode warning would be a good follow-up.
  • The DataTable tests already passed before this change. The fix is kept because it corrects a real stale-closure bug.
  • Some code comments still describe the old bugs and could be cleaned up.
  • tsc is not on PATH, so the type check was run with bunx tsc --noEmit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant